<?php
//管理后台商品管理
class product extends module_product{
	
	protected function index(){
		parent::index();
		//提取所有商家，供前台检索使用
		global $Base,$Db,$tp;
		$sql = "select id,name from ".$Base->table('company')." where p_id=0 order by id desc";
		$cps = $Db->query($sql);
		$tp->assign('cps',$cps);
	}
	
	protected function check_product_exists($p_id){
		global $Base,$Db;
		$sql = "select * from ".$Base->table('company_product')." where id=$p_id ";
		return $Db->query($sql,'Row');
	}
	
}
new product();
?>